<template>
  <div style="background-color: #000;">
    <div class="container">
      <el-row v-cloak>
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <div v-if="rzstatus !== 2&&rzstatus !== ''" v-cloak>
            <el-alert type="warning" class="alert-warning">
              <div class="warning">
                <img src="../../../static/tingxingrz.png" alt="" style="
                float:left;
                    width: 20px;
                    height: 20px;
                    margin-top: 1px;
                  " />
                <div class="alert_text">
                  您当前尚未实名认证，请进行实名认证，享受更多实名权益。
                  <a href="#" class="a_text" @click="goUrl('/detailInfoto', 'detailInfoto')"
                    style="color:#ff7226">立即实名认证</a>
                  <img src="../../../static/tingxingrz2.png" alt="" style="
                    width: 34px;
                    height: 34px;
                    text-align: center;
                    margin-top: -1px;
                    margin-left:10%
                  ">
                  <span>现在实名认证即可无限制使用，不限下载次数！！！</span>
                </div>
              </div>
            </el-alert>
          </div>
          <div v-else-if="rzstatus==2" class="aleart-warning-rz" v-cloak>
            <el-alert type="warning">
              <!-- <div style="display:flex;flex-direction: row;">
                <img src="../../../static/icon_tishi@2x.png" alt=""
                  style="width: 16px;height: 16px;text-align: center;margin-top: -1px;">
                <div class="alert_text">您当前尚未实名认证，请进行实名认证，享受更多实名权益。<a href="#" class="a_text"
                    @click="goUrl('/detailInfoto','detailInfoto')">立即实名认证</a></div>
              </div> -->
              <div class="warning-rz">
                <img src="../../../static/tixingtztg.png" alt="" style="
                float:left;
                    width: 20px;
                    height: 20px;
                    margin-top: 1px;
                  " />
                <div class="alert_text">
                  恭喜您已通过实名认证，即可享受无限制上传，无限制下载次数！！！
                </div>
              </div>
            </el-alert>
          </div>
        </el-col>
      </el-row>
      <!-- 面包屑start -->
      <el-breadcrumb separator="/" class="breadCrumb_Box">
        <el-breadcrumb-item><a @click="goUrl('/adhibition', 'adhibition')">我的应用</a></el-breadcrumb-item>
        <el-breadcrumb-item>{{ c_breadCrumb_name }}</el-breadcrumb-item>
      </el-breadcrumb>
      <!-- 面包屑end -->
      <el-row class="tac content">
        <el-col :xs="24" :sm="24" :md="24" :lg="4" :xl="4">
          <Navmenu @handleClick="handleClick"></Navmenu>
        </el-col>

        <el-col :xs="24" :sm="24" :md="24" :lg="20" :xl="20">
          <!-- <appList></appList> -->
          <div v-if="active == 0">
            <upfile isvip="0"></upfile>
          </div>
          <div v-if="active == 1">
            <appList></appList>
          </div>
          <div v-if="active == 2">
            <mergeApplication></mergeApplication>
          </div>
        </el-col>
      </el-row>
    </div>
    <statement></statement>
  </div>
</template>

<script>
  import appList from "@/components/adhibitionMember/app";
  import upfile from "@/components/adhibitionMember/upfile";
  import mergeApplication from "@/components/adhibitionMember/mergeApplication";
  import Navmenu from "@/components/adhibitionMember/menu";
  import statement from "@/components/common/statement";
  import test from "../Yee/test.vue";
  export default {
    //import引入的组件需要注入到对象中才能使用
    components: {
      appList,
      Navmenu,
      statement,
      upfile,
      mergeApplication,
    },
    data() {
      //这里存放数据
      return {
        c_breadCrumb_name: "应用列表",
        // 记录当前tab页
        active: 1,
        rzstatus: "", //实名状态
      };
    },
    //监听属性 类似于data概念
    computed: {},
    //监控data中的数据变化
    watch: {},
    //方法集合
    methods: {
      goUrl(path, name) {
        if (name == "adhibition") {
          location.reload();
        }
        this.$router.push({
          path: path,
          name: name,
        });
      },
      // 接收tab传回来的当前页  刷新存在问题 解决办法 存session 第一个页面为对应的组件 第二个类推 需要拆分出来
      handleClick(index) {
        this.active = index;
        if (this.active == 0) {
          this.c_breadCrumb_name = "上传应用";
        } else if (this.active == 1) {
          this.c_breadCrumb_name = "应用列表";
        } else {
          this.c_breadCrumb_name = "已合并应用";
        }
      },
      //实名状态
      getList() {
        this.$post(this.API.UserMsg).then((res) => {
          // console.log(res);
          let data = res.data;
          this.rzstatus = data.rzstatus;
          // console.log(this.rzstatus,"rzstatus");
        });
      },
    },
    //生命周期 - 创建完成（可以访问当前this实例）
    created() {
      console.log(this.active);
      var token_time = sessionStorage["token_time"];
      token_time = parseInt(token_time);
      token_time = token_time + 3600000;
      var now = new Date().getTime();
      if (token_time < now || token_time == undefined || isNaN(token_time)) {
        console.log("未登录");
        this.hasLogin = false;

        //跳转到登录
        sessionStorage.setItem("currentTab_title", "");
        this.$router.push({
          path: "/login",
          name: "login",
        });

        return;
      }
      // console.log(this.active);
      // if (sessionStorage.getItem('setMenuIndex_application') != null) {
      //   this.active = sessionStorage.getItem('setMenuIndex_application')
      //   if (this.active == 0) {
      //     this.c_breadCrumb_name = "上传应用";
      //   } else if (this.active == 1) {
      //     this.c_breadCrumb_name = "应用列表";
      //   } else {
      //     this.c_breadCrumb_name = "已合并应用";
      //   }
      // }

      this.getList();
      // this.active = sessionStorage.getItem("currentAdhibitionIndex");
    },
    //生命周期 - 挂载完成（可以访问DOM元素）
    mounted() {

    },
  };

</script>
<style scoped>
  [v-cloak] {
    display: none !important;
  }

  .container {
    background-color: #000;
  }

  /* 面包屑  */
  .breadCrumb_Box {
    margin-top: 30px;
  }

  .content {
    margin: 20px 0px 30px 0px;
    background: rgba(30, 30, 30, 0.8);
    box-shadow: 0px 4px 10px 2px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    overflow: hidden;
  }

  .alert-warning {
    display: block;
  }

  .aleart-warning-rz {
    display: block;
  }

  .aleart-warning-rz .el-alert.el-alert--warning.is-light {
    background-color: #d8ecfb;
  }

  div>>>.el-alert--warning.is-light {
    padding: 0px;
  }

  div>>>.el-alert .el-alert__description {
    margin: 0px;
  }

  .warning {
    height: 40px;
    text-align: left;
    width: 100%;
    padding: 5px 3px;
    padding-top: 8px;
  }

  .warning-rz {
    height: 40px;
    text-align: left;
    width: 100%;
    padding: 5px 3px;
    padding-top: 8px;
    background-color: #d8eefb;
  }

  div>>>.el-alert__content {
    display: block;
  }

  .warning .alert_text {
    color: #fff;
    line-height: 30px;
    font-size: 14px;
    padding-left: 4px;
    text-align: left;
    display: inline-block;
    width: calc(100% - 100px);
  }

  .warning-rz .alert_text {
    color: #000;
    line-height: 30px;
    font-size: 14px;
    padding-left: 4px;
    text-align: left;
    display: inline-block;
  }

  .el-alert--warning.is-light {
    background-color: rgba(30, 30, 30, 0.8);
  }

  .alert_text {
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #c0a375;
    margin-top: -3px;
    margin-left: 5px;
  }

  .a_text {
    font-size: 14px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #71b7ec;
    margin-top: -2px;
  }

  a {
    text-decoration: none;
  }

  div>>>.el-alert__content .el-alert__closebtn {
    font-size: 18px;
    color: #ff762c;
    margin-top: 0px;
  }

  div>>>.aleart-warning-rz .el-alert .el-alert__content .el-alert__closebtn,
  div>>>.aleart-warning-rz .el-alert .el-alert__content .el-icon-close {
    color: #2c81ff;
  }

  @media (max-width: 414px) {
    .alert_text {
      font-size: 12px;
    }

    .a_text {
      font-size: 12px;
    }
  }

  .breadCrumb_Box>>>.el-breadcrumb__inner a {
    color: #ee7829;
  }

  .breadCrumb_Box>>>.el-breadcrumb__item .el-breadcrumb__separator {
    color: #fff;
  }

  .breadCrumb_Box>>>.el-breadcrumb__item .el-breadcrumb__inner {
    color: #fff;
  }

</style>

<style>
  [v-cloak] {
    display: none !important;
  }

</style>
